685d26b394cc27513a7baa0d36780401ec5acf38,hazelcast/src/main/java/com/hazelcast/impl/wan/WanNoDelayReplication.java,WanNoDelayReplication,getConnection,#,107
Before Change
@SuppressWarnings("BusyWait")
Connection getConnection() throws InterruptedException {
while (true) {
String targetStr = addressQueue.take();
Address target = null;
try {
target = null;
int colon = targetStr.indexOf(':');
if (colon == -1) {
target = new Address(targetStr, node.getConfig().getPort());
} else {
target = new Address(targetStr.substring(0, colon), Integer.parseInt(targetStr.substring(colon + 1)));
}
Connection conn = node.getConnectionManager().getOrConnect(target);
for (int i = 0; i < 10; i++) {
conn = node.getConnectionManager().getConnection(target);
if (conn == null) {
Thread.sleep(1000);
} else {
After Change
@SuppressWarnings("BusyWait")
Connection getConnection() throws InterruptedException {
while (running) {
String targetStr = addressQueue.take();
try {
final AddressHolder addressHolder = AddressUtil.getAddressHolder(targetStr, node.getConfig().getPort());
final Address target = new Address(addressHolder.address, addressHolder.port);
final ConnectionManager connectionManager = node.getConnectionManager();
Connection conn = connectionManager.getOrConnect(target);
for (int i = 0; i < 10; i++) {
if (conn == null) {